package com.klhappy.houyuan.modle;

import android.content.Context;

import com.klhappy.houyuan.constant.KeyConstant;
import com.klhappy.houyuan.constant.UrlConstant;
import com.klhappy.houyuan.utils.BaseModel;
import com.klhappy.houyuan.utils.ConfigManager;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by MrPu on 15/11/24.
 */
public class AboutYardModle extends BaseModel{

    private Context context;

    private Map<String ,String> params = new HashMap<>() ;

    private ConfigManager manage;
    private String cookie;

    public AboutYardModle(Context context) {
        super(context);
        this.context = context;
        manage = new ConfigManager(context);
        cookie = manage.get(KeyConstant.session, cookie);
    }

    //获取版本号
    public void getUpdate(int type ,String ver){
        String path = UrlConstant.VER_URL;

        params.put("plat_type" ,type + "");
        params.put("client_ver", ver + "");
        Callback(path, params);
    }

    //退出
    public void getQuit(){
        String path = UrlConstant.LOGOUT_URL;

        Callback(path, params, cookie);
    }
}
